package com.ruoyi.technician.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.technician.mapper.GradeConfigMapper;
import com.ruoyi.technician.domain.GradeConfig;
import com.ruoyi.technician.service.IGradeConfigService;

/**
 * 分成设置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-07
 */
@Service
public class GradeConfigServiceImpl implements IGradeConfigService 
{
    @Autowired
    private GradeConfigMapper gradeConfigMapper;

    /**
     * 查询分成设置
     * 
     * @param id 分成设置主键
     * @return 分成设置
     */
    @Override
    public GradeConfig selectGradeConfigById(Long id)
    {
        return gradeConfigMapper.selectGradeConfigById(id);
    }

    /**
     * 查询分成设置列表
     * 
     * @param gradeConfig 分成设置
     * @return 分成设置
     */
    @Override
    public List<GradeConfig> selectGradeConfigList(GradeConfig gradeConfig)
    {
        return gradeConfigMapper.selectGradeConfigList(gradeConfig);
    }

    /**
     * 新增分成设置
     * 
     * @param gradeConfig 分成设置
     * @return 结果
     */
    @Override
    public int insertGradeConfig(GradeConfig gradeConfig)
    {
        gradeConfig.setCreateTime(DateUtils.getNowDate());
        return gradeConfigMapper.insertGradeConfig(gradeConfig);
    }

    /**
     * 修改分成设置
     * 
     * @param gradeConfig 分成设置
     * @return 结果
     */
    @Override
    public int updateGradeConfig(GradeConfig gradeConfig)
    {
        gradeConfig.setUpdateTime(DateUtils.getNowDate());
        return gradeConfigMapper.updateGradeConfig(gradeConfig);
    }

    /**
     * 批量删除分成设置
     * 
     * @param ids 需要删除的分成设置主键
     * @return 结果
     */
    @Override
    public int deleteGradeConfigByIds(Long[] ids)
    {
        return gradeConfigMapper.deleteGradeConfigByIds(ids);
    }

    /**
     * 删除分成设置信息
     * 
     * @param id 分成设置主键
     * @return 结果
     */
    @Override
    public int deleteGradeConfigById(Long id)
    {
        return gradeConfigMapper.deleteGradeConfigById(id);
    }
}
